fix(lcx-doctor): use ${TMPDIR:-/tmp} and fix obsolete aggregate hook layout check#84
Conversation
…n check The lcx-doctor skill had two correctness bugs reported in issue code-yeongyu#80: 1. Hardcoded /tmp: the skill instructed the agent to sync sources to /tmp/lazycodex-source and /tmp/openai-codex-source. On systems where /tmp is restricted or TMPDIR points elsewhere this fails. Replace every hardcoded /tmp path with ${TMPDIR:-/tmp}, and introduce a SOURCE_ROOT variable in the bash sync snippet so callers only set it once. 2. Obsolete aggregate hook layout check: step 3 told the doctor to verify a hooks/hooks.json file under the installed plugin root. The current aggregate OMO plugin manifest (verified by test/aggregate-manifest.test.mjs) enumerates individual hook files directly in the hooks array — an aggregate hooks.json is not used. Replace the check with the current correct shape: individual hook JSON files under hooks/ as listed in plugin.json. RED->GREEN: added two new assertions to the existing lcx-doctor block in test/lcx-bug-skills.test.mjs. Both failed before this change and pass after. Closes code-yeongyu#80
|
Thanks for the PR! Changes to LazyCodex land through oh-my-openagent — could you open this against omo-codex over there instead? PRs in this repository can't be merged. This PR was closed because it changes source-code paths in this repository: If you're working with a coding agent, prompt it like this:
|
Closes #80
Bug
lcx-doctorhad two correctness issues (Problems 1 and 3 from #80):Hardcoded
/tmp— the skill instructed the agent to sync sources to/tmp/lazycodex-sourceand/tmp/openai-codex-source. On systems where/tmpis restricted orTMPDIRpoints elsewhere this silently breaks source sync.Obsolete aggregate hook layout check — Step 3 directed the doctor to verify a
hooks/hooks.jsonfile under the installed plugin root. The current aggregate OMO plugin manifest (plugin.json) enumerates individual hook file paths directly in itshooksarray;hooks/hooks.jsonis not used (this is explicitly asserted intest/aggregate-manifest.test.mjs). Checking for it produces a false negative against a correct installation.Fix
/tmppath with${TMPDIR:-/tmp}throughoutlcx-doctor/SKILL.md. Introduce aSOURCE_ROOT="${TMPDIR:-/tmp}"variable in the bash sync snippet so it is set once.hooks/hooks.jsonpayload check with the correct description: individual hook JSON files underhooks/enumerated directly inplugin.json'shooksarray.Verification
Added two new assertions to the existing
lcx-doctortest block inplugins/omo/test/lcx-bug-skills.test.mjs:RED before:
node --test test/lcx-bug-skills.test.mjs→ 2 pass / 1 failGREEN after:
node --test test/lcx-bug-skills.test.mjs→ 3 pass / 0 failAdjacent tests:
node --test test/aggregate-manifest.test.mjs test/aggregate-skills.test.mjs test/aggregate-hooks.test.mjs→ 18 pass / 0 failSummary by cubic
Fixes two correctness bugs in
lcx-doctor: it now honors${TMPDIR:-/tmp}for source sync and checks the current aggregate hook layout, preventing false negatives and broken runs on systems with restricted/tmp./tmppaths with${TMPDIR:-/tmp}; introduced aSOURCE_ROOTvariable in the sync snippet.hooks/as listed inplugin.json; removed the obsoletehooks/hooks.jsoncheck.hooks/hooks.json).Written for commit 0db6024. Summary will update on new commits.